/**
 * @param cfg configuration
 * {
 *   localeInFirst;
 * }
 */
var ljsf;
Ljs.LJSF=function(cfg){
	if(ljsf){
		alert('LJSF has initilized!');
		return ljsf;
	}
	var uri=window.location.search;
	var contextId;
	uri=uri?uri.substring(1):'';
	var i=uri.indexOf('?');
	if(i>0){
		queryString=uri.substring(i);
		uri = uri.substring(0,i);
	}else{
		queryString='';
	}
	this.getParam=function(key){
		return URLUtils.getParam(queryString,key);
	}
	alert(uri);
	if(cfg.localPerfix){
		if(!uri){
			window.location.href='?zh_CN/';
		}
		var i = uri.indexOf('/');
		locale = uri.substring(0,i);
		path = uri.substring(i+1);
		var locales=locale.split('_');
	}else{
		locale=this.getParam('locale')||Cookie.get('ljsf_locale')|| defaultLocale || 'en';
		path = uri.substring(i+1);
	}
	Cookie.set('ljsf_locale',locale);
	
	this.getUri=function(){
		return uri;
	}
	this.getPath=function(){
		return path;
	}
	this.getQueryString=function(){
		return queryString;
	}
	this.getLocale=function(){
		return locale;
	}
	this.replaceParam(key,value){
		
	}
	
	window.onDomReady(function(){
		
	});
	

};
window.onDomReady(function(){
	//later and default initilizer;
	ljsf=ljsf||new Ljs.LJSF({localPerfix:false});//for ide resone,not support closure;
	alert('local:'+ljsf.getLocale());
	alert('qs:'+ljsf.getQueryString());
	alert('path:'+ljsf.getPath());
	alert('uri:'+ljsf.getUri());
});